package cn.caplike.demo.repository.design.pattern.eventbus.jdk.simple;

public class Client {

    public static void main(String[] args) {
        final EventListener<Event> eventListener = new EventListener<Event>() {
            @Override
            public Class<Event> getInterest() {
                return Event.class;
            }

            @Override
            public void handle(Event event) {
                System.out.println("Received message: " + event.getMessage());
            }
        };
        EventBus.register(eventListener);

        EventBus.post(new Event("123"));
    }
}
